package service

import (
	"usplatformserver/internal/model"
)

// int为0值时，golang默认处理成null，这里OrganType改为*int类型
type PatientImageListRequest struct {
	OrganType    *int   `form:"organType" binding:"required,gte=0"`
	PatientStamp string `form:"patientStamp"`
}

type PatientImageGroupRequest struct {
	OrganType    *int   `form:"organType" binding:"required,gte=0"`
	ImageID      *int   `form:"imageId" binding:"required,gte=0"`
	ImageType    *int   `form:"imageType" binding:"required,gte=0"`
	BoxId        *int   `form:"boxId" binding:"required"`
	PatientStamp string `form:"patientStamp"`
}

// 获取患者图片列表
func (svc *Service) GetPatientImageList(param *PatientImageListRequest) ([]*model.PatientImageInfo, error) {
	return svc.dao.GetPatientImageList(*param.OrganType, param.PatientStamp)
}

// 查询图片组信息
func (svc *Service) GetImageGroup(param *PatientImageGroupRequest) ([]*model.PatientImageInfo, error) {
	return svc.dao.GetImageGroup(param.PatientStamp, *param.OrganType, *param.ImageID, *param.ImageType, *param.BoxId)
}

// 查询甲状腺图片列表（按时间倒序）
func (svc *Service) GetThyroidImageListDescByTime(param *PatientImageListRequest) ([]*model.PatientImageInfo, error) {
	return svc.dao.GetThyroidImageListDescByTime(param.PatientStamp)
}

// 查询乳腺图片列表（按时间倒序）
func (svc *Service) GetBreastImageListDescByTime(param *PatientImageListRequest) ([]*model.PatientImageInfo, error) {
	return svc.dao.GetBreastImageListDescByTime(param.PatientStamp)
}
